@echo off

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::                                                        ::
:: This script erases all files created during build      ::
::                                                        ::
::                                                        ::
:: February//04/2012                                      ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: ERASE THE BINARY AND IMAGE FILES                       ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

if /i exist ".\build\bin\*.*" del /q ".\build\bin\*.*"
if /i exist ".\build\img\*.*" del /q ".\build\img\*.*"

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: ERASE THE FILES THAT WERE MADE IN THE SOURCE DIR       ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

if /i exist ".\source\*.bin"      del /q ".\source\*.bin"
if /i exist ".\source\*.sys"      del /q ".\source\*.sys"
if /i exist ".\source\*.com"      del /q ".\source\*.com"
if /i exist ".\source\*.exe"      del /q ".\source\*.exe"
if /i exist ".\source\boot\*.bin" del /q ".\source\boot\*.bin"
if /i exist ".\source\boot\*.sys" del /q ".\source\boot\*.sys"

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: ERASE FILES MADE DURING BUILD PROCESS                  ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

if /i exist ".\stage1.bin"   del /q ".\stage1.bin"
if /i exist ".\stage2.bin""  del /q ".\stage2.bin"
if /i exist ".\kernel32.exe" del /q ".\kernel32.exe"
if /i exist ".\quore32.img"  del /q ".\quore32.img"

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: ERASE FILES MADE DURING PACKAGING                      ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

if /i exist ".\QUOREOS-src.zip" del /q "QUOREOS-src.zip"
if /i exist ".\QUOREOS-img.zip" del /q "QUOREOS-img.zip"
if /i exist ".\QUOREOS-man.zip" del /q "QUOREOS-man.zip"

echo.
echo.
time /t > time.txt
set /p time=<time.txt
del /q time.txt
echo Completed cleaning on %DATE% at %time%
pause>nul

